/**
 * 最小生成树：克鲁斯卡尔算法
 * 按照权值从小打大的顺序选择n-1条边，并保证不构成回路
 *
 */


public class KruskalCase {
    private int edgeNum;//边的个数
    private char[] vertexs;//顶点数组
    private int[][] matrix;//接连矩阵
    private static final int INF = Integer.MAX_VALUE;

    public static void main(String[] args) {
        char[] vertexs = {'A', 'B', 'C', 'D', 'E', 'F', 'G'};


        int[][] matrix = new int[][]{
                {0, 12, INF, INF , INF, 16, 14},
                {12, 0, 10, INF , INF, 7, INF},
                {INF , 10, 0, 3, 5, 6, INF},
                {INF, INF, 3, 0, 4, INF, INF},
                {INF, INF, 5, 4, 0, 2, 8},
                {16, 7, 6, INF, 2, 0, 9},
                {14, INF, INF, INF, 8, 9, 0},
        };
    }


}
